import Vue from 'vue'
import VueRouter from 'vue-router'
import Api from '../views/Api.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Api',
    component: Api
  },
  {
    path: '/echarts',
    name: 'index',
    component: () => import('@/views/Echarts/index.vue'),
    redirect:'/echarts/chart',
    children: [
      {
        path: '/echarts/chart',
        name: 'Echarts',
        component: () => import('@/views/Echarts/Echarts.vue')
      },
      {
        path: '/echarts/map',
        name: 'Map',
        component: () => import('@/views/Echarts/Map.vue')
      },
      {
        path: '/echarts/radar',
        name: 'Map',
        component: () => import('@/views/Echarts/Radar.vue')
      }, {
        path: '/echarts/gplot',
        name: 'Map',
        component: () => import('@/views/Echarts/Gplot.vue')
      }, {
        path: '/echarts/ganttChart',
        name: 'Map',
        component: () => import('@/views/Echarts/ganttChart.vue')
      },
    ]
  },
  {
    path: '/jsplumb',
    name: 'jsplumb',
    component: () => import('@/views/JsPlumb/index.vue')
  },
  {
    path: '/k-form-design',
    name: 'KFormDesign',
    component: () => import('@/views/KFormDesign/index.vue')
  },
  {
    path: '/yesapiss',
    name: 'Yesapi',
    component: () => import('@/views/Yesapi/index.vue')
  },
  {
    path: '/vueFullcalendar',
    name: 'vueFullcalendar',
    component: () => import('@/views/vueFullcalendar/vueFullcalendar.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
